//
// Created by Zhangwj on 2023/9/27.
//

#ifndef COMPILE_TASK2_UNARYEXPNODE_H
#define COMPILE_TASK2_UNARYEXPNODE_H


#include "SyntaxTreeNode.h"
#include "../Parser.h"
#include "PrimaryExpNode.h"
#include "UnaryOpNode.h"
#include "FuncRParamsNode.h"

class UnaryExpNode : public SyntaxTreeNode {
public:
    // UnaryExp → PrimaryExp | Ident '(' [FuncRParams] ')'
    // | UnaryOp UnaryExp
    std::unique_ptr<PrimaryExpNode> PrimaryExp;
    std::unique_ptr<IdentNode> Ident;
    std::unique_ptr<FuncRParamsNode> FuncRParams;
    std::unique_ptr<UnaryOpNode> UnaryOp;
    std::unique_ptr<UnaryExpNode> UnaryExp;

    static std::unique_ptr<UnaryExpNode> UnaryExpParser(Parser &parser);
};


#endif //COMPILE_TASK2_UNARYEXPNODE_H
